import 'package:flutter/material.dart';
import 'package:get/get.dart';

/// 模板变量模型 - Template Variable Model
///
/// 用于管理 Prompt 中的模板变量
/// Used for managing template variables in Prompt
class TemplateVariable {
  String name;
  String description;
  String defaultValue;

  TemplateVariable({
    required this.name,
    required this.description,
    required this.defaultValue,
  });
}

/// 编辑页面状态管理 - Edit Page State Management
///
/// 管理编辑页面的所有状态数据
/// Manages all state data for the edit page
class EditState {
  // 控制器 - Controllers
  final TextEditingController titleController = TextEditingController();
  final TextEditingController descriptionController = TextEditingController();
  final TextEditingController contentController = TextEditingController();

  // 基本状态 - Basic State (使用响应式变量)
  final RxBool isNewPrompt = true.obs;
  final RxBool isPreviewMode = false.obs;
  final RxBool hasUnsavedChanges = false.obs;
  final RxString promptId = ''.obs;

  // 内容统计 - Content Statistics (使用响应式变量)
  final RxInt wordCount = 0.obs;
  final RxInt characterCount = 0.obs;
  final RxInt lineCount = 0.obs;

  // 属性设置 - Property Settings (使用响应式变量)
  final RxString selectedCategory = ''.obs;
  final RxList<String> selectedTags = <String>[].obs;
  final RxString selectedFormat = 'md'.obs;
  final RxList<String> categories = <String>[].obs;
  final RxString language = 'zh-CN'.obs;
  final RxString difficulty = 'medium'.obs;
  final RxBool isPublic = false.obs;
  final RxBool isFavorite = false.obs;

  // 模板变量 - Template Variables (使用响应式变量)
  final RxList<TemplateVariable> variables = <TemplateVariable>[].obs;

  // 版本管理 - Version Management (使用响应式变量)
  final RxInt currentVersion = 1.obs;
  final RxInt totalVersions = 1.obs;
}
